package site.wlwsjsx.iot_backend.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 工位详情DTO，供管理员查询使用
 */
@Data
@Getter
@Setter
public class WorkstationDetailDTO {
    // 工位基础信息
    private Integer id;
    private String workstationCode;
    private String workstationStatus; // 工位状态 (normal, etc.)

    // 使用者信息 (可以从 user_info 表获取)
    private Integer curUserId;
    private String username; // 使用者账号
    private String realName; // 使用者真实姓名

    // 设备控制状态
    private Integer powerStatus;
    private Integer lightStatus;
    private Integer relayNum1Status;
    private Integer relayNum2Status;

    // 环境传感器数据
    private Float temperature;
    private Float humidity;
    private Float smokeScope;
    private Float lightIntensity;
    private Float flameScope;

    // 时间信息
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime modifyTime;

    public WorkstationDetailDTO() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getWorkstationCode() {
        return workstationCode;
    }

    public void setWorkstationCode(String workstationCode) {
        this.workstationCode = workstationCode;
    }

    public String getWorkstationStatus() {
        return workstationStatus;
    }

    public void setWorkstationStatus(String workstationStatus) {
        this.workstationStatus = workstationStatus;
    }

    public Integer getCurUserId() {
        return curUserId;
    }

    public void setCurUserId(Integer curUserId) {
        this.curUserId = curUserId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public Integer getPowerStatus() {
        return powerStatus;
    }

    public void setPowerStatus(Integer powerStatus) {
        this.powerStatus = powerStatus;
    }

    public Integer getLightStatus() {
        return lightStatus;
    }

    public void setLightStatus(Integer lightStatus) {
        this.lightStatus = lightStatus;
    }

    public Integer getRelayNum1Status() {
        return relayNum1Status;
    }

    public void setRelayNum1Status(Integer relayNum1Status) {
        this.relayNum1Status = relayNum1Status;
    }

    public Integer getRelayNum2Status() {
        return relayNum2Status;
    }

    public void setRelayNum2Status(Integer relayNum2Status) {
        this.relayNum2Status = relayNum2Status;
    }

    public Float getTemperature() {
        return temperature;
    }

    public void setTemperature(Float temperature) {
        this.temperature = temperature;
    }

    public Float getHumidity() {
        return humidity;
    }

    public void setHumidity(Float humidity) {
        this.humidity = humidity;
    }

    public Float getSmokeScope() {
        return smokeScope;
    }

    public void setSmokeScope(Float smokeScope) {
        this.smokeScope = smokeScope;
    }

    public Float getLightIntensity() {
        return lightIntensity;
    }

    public void setLightIntensity(Float lightIntensity) {
        this.lightIntensity = lightIntensity;
    }

    public Float getFlameScope() {
        return flameScope;
    }

    public void setFlameScope(Float flameScope) {
        this.flameScope = flameScope;
    }

    public LocalDateTime getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(LocalDateTime modifyTime) {
        this.modifyTime = modifyTime;
    }

    @Override
    public String toString() {
        return "WorkstationDetailDTO{" +
                "id=" + id +
                ", workstationCode='" + workstationCode + '\'' +
                ", workstationStatus='" + workstationStatus + '\'' +
                ", curUserId=" + curUserId +
                ", username='" + username + '\'' +
                ", realName='" + realName + '\'' +
                ", powerStatus=" + powerStatus +
                ", lightStatus=" + lightStatus +
                ", relayNum1Status=" + relayNum1Status +
                ", relayNum2Status=" + relayNum2Status +
                ", temperature=" + temperature +
                ", humidity=" + humidity +
                ", smokeScope=" + smokeScope +
                ", lightIntensity=" + lightIntensity +
                ", flameScope=" + flameScope +
                ", modifyTime=" + modifyTime +
                '}';
    }
}